<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/jspcommon.jsp"%>
<%@include file="../common/jscss.jsp"%>
<script type="text/javascript">
	var madeAuditGrid = null;
	$(function(){
		madeAuditGrid = $("#made_audit_grid").ligerGrid({
				title : '客户定制列表',
                columns: [
							{
								display: '操作', 
								name: 'id',
								isAllowHide: false, 
								isSort : false,
								render: function (record, rowindex, value, column){
									 if(record.status=='01'){
										 var html = '<a onclick="aduitMade(\''+ value + '\')" href="javascript:;">通过</a>&nbsp;'; 
											return html; 
		       	                	  }
								}
							},
							{ display: '审核状态', name: 'status',isSort : false,
		       	                  render: function(record, rowindex, value, column){
		       	                	  if(value=='01'){
		       	                		  return "<span>未审核</span>"; 
		       	                	  }else if(value=='02'){
		       	                		  return "<span style='color: red;'>已通过</span>"; 
		       	                	  }
		       	                  }},
						{ display: '审核编号', name: 'id',isSort : false },
						 { display: '定制订单编号', name: 'madeId',isSort : false },
                     	 { display: '定制阶段', name: 'auditKey',isSort : false,
       	                  render: function(record, rowindex, value, column){
       	                	  if(value=='01'){
       	                		  return "<span>第一阶段</span>"; 
       	                	  }else if(value=='02'){
       	                		  return "<span>第二阶段</span>"; 
       	                	  }else if(value=='03'){
       	                		  return "<span>第三阶段</span>"; 
       	                	  }else if(value=='04'){
       	                		  return "<span>已完成</span>"; 
       	                	  }
       	                	 
       	                  }},
	                  { display: '首付款', name: 'firstMoney',isSort : false },
	                  { display: '中间款', name: 'secondMoney',isSort : false },
	                  { display: '尾款', name: 'thirdMoney',isSort : false },
	                  { display: '总价', name: 'totalMoney',isSort : false },
	                  { display: '开始时间', name: 'startDate',isSort : false },
	                  { display: '结束时间', name: 'endDate',isSort : false },
	                  { display: '详细内容', name: 'remark',isSort : false},
                { display: '提交时间', name: 'gmtCreated',isSort : false,
                  render: function(record, rowindex, value, column){
                	 return (new Date(value.time)).format("yyyy年MM月dd日 hh:mm:ss");
                  }}
                
                ], 
                pageSize:30,
                root :'list',
                record:'totalRecord',
                url: "/misc/artMade/madeAuditListGrid.htm", 
                width: '99%',height:'99%'
            });


	});
	
	//审批
	function aduitMade(auditId){
		
		$.ligerDialog.confirm('你确定通过吗？', 
				function (yes){
					if(yes){
						$.post("/misc/made/passMadeAudit.htm", {
							auditId :auditId
						},function(data){
							if(data=="success"){
								alert("已通过");
								madeAuditGrid.loadData();
							}
							if(data=="error"){
								alert("出错了。");
							}
						});

					}
				});
		}
</script>
<div id="made_audit_grid" style="margin:0; padding:0"></div>
